Skip to content

Fix hoveranywhere/clickanywhere events over editable shapes#7788

Open
alexshoe wants to merge 1 commit intomasterfrom
fix-shape-anywhere-events
Open

Fix hoveranywhere/clickanywhere events over editable shapes#7788
alexshoe wants to merge 1 commit intomasterfrom
fix-shape-anywhere-events

Conversation

@alexshoe
Copy link
Copy Markdown
Contributor

@alexshoe alexshoe commented May 1, 2026

Description

Fixes #7787.

Editable shapes were swallowing plotly_hover / plotly_click events, so hoveranywhere / clickanywhere never fired over them.

Root cause:
dragElement.init sets element.style.pointerEvents = 'all' inline on the shape path so it can receive drag events. That override beats the CSS rule that normally keeps the shape transparent to events, so mouse events stop at the shape and never reach the nsewdrag rect where hoveranywhere / clickanywhere are wired up.

The Fix:
Forward mousemove and click from the shape path to Fx.hover / Fx.click (with the shape's subplot id) when hoveranywhere / clickanywhere is enabled and the user isn't mid-drag. This mirrors the pattern already used by the hover layer in graph_interact.js.

@alexshoe alexshoe requested review from camdecoster and emilykl May 1, 2026 21:33
@alexshoe alexshoe marked this pull request as ready for review May 1, 2026 21:33
@camdecoster
Copy link
Copy Markdown
Contributor

Could you please provide testing instructions? I'm happy to paste a mock into devtools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: hoveranywhere/clickanywhere events suppressed over editable shapes

2 participants